<include file="public@header"/>
<!-- 拖拽和时间选择的插件样式 chase_add-->
<link rel="stylesheet" href="__STATIC__/js/jquery-ui/jquery-ui.css">
<link rel="stylesheet" href="__STATIC__/js/jquery-ui/jquery-ui.theme.min.css">
<link rel="stylesheet" href="__STATIC__/js/jquery-ui/jquery-ui-timepicker-addon.min.css">


</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li><a href="{:url('Classes/index')}">班级列表</a></li>
        <li class="active"><a href="{:url('Classes/add')}">添加班级</a></li>
    </ul>
    <div class="row margin-top-20">
        <div class="col-md-12 col-lg-10">
            <form action="{:url('Classes/addPost')}" method="post" class="form-horizontal js-ajax-form margin-top-20">
                <div class="row">
                    <div class="col-md-12">
                        <table class="table table-bordered chase_classes_table">
                            <tr>
                                <th>
                                    班级<span class="form-required">*</span>
                                </th>
                                <th>
                                    <input type="text" name="name" class="form-control">
                                    <!-- <span>班级名+创建时间日期+id</span> -->
                                </th>
                            </tr>

                            <tr>
                                <th>关联课程<span class="form-required">*</span></th>
                                <td>
                                    <select class="form-control" name="course_id" id="input-parent1">
                                        <option value="0">选择课程</option>
                                        <foreach name="course_tree" item="vo">
                                            <option value="{$vo['id']}" attr_price="{$vo['total_price']}">
                                                {$vo['course_name']}
                                            </option>
                                        </foreach>
                                    </select>
                                </td>
                            </tr>
                            <tr>
                                <th>班级费用<span class="form-required">*</span></th>
                                <td>
                                    <table>
                                        <tr>
                                            <th class='col-sm-3' style="padding-left:0px;">课程费用</th>
                                            <th class='col-sm-3'>教材费</th>
                                            <th class='col-sm-3'>报名费</th>
                                            <th class='col-sm-3'>合计</th>
                                        </tr>
                                        <tr>
                                            <th class='col-sm-3' style="padding-left:0px;">
                                                <input type="number" class="form-control"  name="lesson_price" id="lesson_price" readonly>
                                            </th>
                                            <th class='col-sm-3'>
                                                <input type="number" class="form-control" name="incidental_price" id="input-name9">
                                            </th>
                                            <th class='col-sm-3'>
                                                <input type="number" class="form-control" name="signup_price" id="input-name5">
                                            </th>
                                            <th class='col-sm-3'>
                                                <input type="number" class="form-control" name="total_price" id="input-name66" readonly>
                                            </th>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                            <tr>
                                <th> 授课老师<span class="form-required"></span></th>
                                <td>
                                    <div class="col-sm-3" style="padding-left:0;">
                                        <select class="form-control" name="teacher_id" id="input-parent11">
                                            <option value="0">选择授课老师</option>
                                            <foreach name="teacher_tree" item="vo">
                                                <option value="{$vo['id']}">
                                                    {$vo['user_login']}
                                                </option>
                                            </foreach>
                                        </select>
                                    </div>
                                    <div class="col-sm-3">
                                        <input type="checkbox"  name="is_teacher_visible" value="1">前台可见
                                    </div>
                            </tr>
                            <tr>
                                <th>开课时间<span class="form-required">*</span></th>
                                <td>
                                    <div class="col-sm-3" style="padding-left:0px;">
                                        <input type="text" class="form-control" id="input-name244" name="start_lesson_time" placeholder="请选择开课时间">
                                    </div>
                                </td>
                            </tr>
                            <tr id="class_time">
                                <th>上课时段<span class="form-required">*</span></th>
                                <td>
                                    <div class="col-sm-3" style="padding-left:0px;">
                                        <select name="class_start_week[]" class="form-control" id="class_start_week">
                                            <option value="1">每周一</option>
                                            <option value="2">每周二</option>
                                            <option value="3">每周三</option>
                                            <option value="4">每周四</option>
                                            <option value="5">每周五</option>
                                            <option value="6" selected>每周六</option>
                                            <option value="7">每周日</option>
                                        </select>
                                    </div>
                                    <div class="col-sm-3">
                                        <input type="time" class="form-control" id="input-name3" name="class_time_start[]" placeholder="请选择上课开始时间">
                                    </div>
                                    <div class="col-sm-3">
                                        <input type="time" class="form-control" id="input-name3311" name="class_time_end[]" placeholder="请选择上课结束时间">
                                    </div>
                                    <div class="col-sm-3">
                                        <a  class="btn btn-success" id="Js_add">添加</a>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <th>报名时间<span class="form-required" style="padding-left:0px;">*</span></th>
                                <td>
                                    <div class="col-sm-3" style='padding-left:0px;'>
                                        <input type="text" class="form-control" id="input-name113" name="signup_start" placeholder="请选择报名开始时间">
                                    </div>
                                    <!--<div class="col-sm-3">-->
                                        <!--<input type="text" class="form-control" id="input-name33" name="signup_end" placeholder="请选择报名结束时间">-->
                                    <!--</div>-->
                                </td>
                            </tr>
                            <tr>
                                <th>可见范围</th>
                                <td>
                                    <select name="visible_type" class="form-control"  id="">
                                        <option value="0">
                                            全部可见
                                        </option>
                                        <option value="1">
                                            仅预选排队家长可见
                                        </option>
                                        <option value="3">
                                            仅在籍预选家长可见
                                        </option>
                                    </select>
                                </td>
                            </tr>

                            <tr>
                                <th>所属校区<span class="form-required">*</span></th>
                                <td>
                                    <select class="form-control" name="school_id" id="input-parent2" >
                                        <option value="111">选择校区</option>
                                        <foreach name="school_tree" item="vo">
                                            <option value="{$vo['id']}">
                                                {$vo['name']}
                                            </option>
                                        </foreach>
                                    </select>
                                </td>
                            </tr>
                            <tr>
                                <th>选择教室<span class="form-required">*</span></th>
                                <td>
                                    <select class="form-control" name="classroom_id" id="input-parent13" disabled="true">
                                    <option value="0">请先选择校区</option>

                                    </select>
                                </td>
                            </tr>
                            <tr>
                                <th>

                                </th>
                                <td  class="printArea">
                                    <div id="selected-seats" class='col-md-9'>
                                        <div id="seat-map">
                                            <div class="front">黑板</div>
                                        </div>
                                        <p style="margin-top:20px;">若需调整座位,请开启座位调整后进行拖拽调整</p>
                                    </div>
                                    <div id="selected-seats-right" class='col-md-3'>
                                        <button class='btn btn-primary open-select-seat noprint' type="button" disabled='true'>开启座位调整</button>
                                        <button class='btn btn-primary print-seat noprint' type="button" disabled='true'>打印座位</button>
                                        <!--<button type="button" id="test">test</button>-->
                                        <div class='select-seat-container noprint' >
                                          <div class="select-seat-box">
                                            保留座位
                                          </div>
                                        </div>
                                        <div id="legend"></div>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <th>续班关联班级</th>
                                <td>
                                    <div class="col-sm-3">
                                        <input type="checkbox" name="is_class" id="enable_class" value="1">是否续班
                                    </div>

                                    <div class="col-sm-3">
                                        <select class="form-control" name="enable_school" id="enable_school" style="display:none">
                                            <!--
                                            <foreach name="school_tree" item="vo">
                                                <option value="{$vo['id']}">
                                                    {$vo['name']}
                                                </option>
                                            </foreach>
                                            -->
                                        </select>
                                    </div>
                                    <div class="col-sm-3">
                                        <select name="enable_class" id="enable_class_ids"  class="form-control" style="display:none">
                                            <option value="0">选择班级</option>

                                        </select>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <th>总人数</th>
                                <td>
                                    <span class="form-control" style="background-color:#ECF0f1">
                                      <span id='student_seat_num' title="已报名学生数">0</span>/
                                      <span id='reserved_seat_num'  title="总共占据座位数">0</span>/
                                      <span id="input-name6" name="total_num" title="班级容纳学生总数"></span>
                                    </span>
                                </td>
                            </tr>
                            <tr>
                                <th>续班说明</th>
                                <td>
                                    <input type="text" class="form-control"  name="continue_class_content" value="" />
                                </td>
                            </tr>
                            <tr>
                                <th>试听</th>
                                <td>
                                    <input type="checkbox" name="is_listen" value="1">允许
                                </td>
                            </tr>
                            <input type="hidden" name="create_time"  value="{:date('Y-m-d H:i:s',time())}">
                        </table>
                        <input type="hidden" name="reserved_seats" id="reserved_seats" value="">
                        <input type="hidden" name="student_seat" id="student_seat" value="">

                        <div class="form-group">
                            <div class="col-sm-offset-2 col-sm-10">
                                <button type="submit" class="btn btn-primary js-ajax-submit" >添加</button>
                                <a class="btn btn-default" href="{:url('Classes/index')}">{:lang('BACK')}</a>
                            </div>
                        </div>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
<!--ajax layer 弹窗-->
<script type="text/javascript" src="__STATIC__/js/admin.js"></script>
<script src="__STATIC__/js/jquery.seat-charts.min.js"></script>
<script type="text/javascript">
    //编辑器路径定义
    var editorURL = GV.WEB_ROOT;
</script>
<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.all.min.js"></script>
<!-- 时间选择的插件 -->
<script type="text/javascript" src="__STATIC__/js/jquery-ui/jquery-ui-timepicker-addon.min.js"></script>
<script type="text/javascript" src="__STATIC__/js/classes_chase.js"></script>
<script type="text/javascript">
$('#input-name244').datepicker();
$("#input-name3311").timepicker();
$("#input-name3").timepicker();
$('#input-name113').datetimepicker();
$(document).ready(function(){
    $url="{:url('Classes/search_class')}";
    $classroom="{:url('Classes/classroom')}";
    $search="{:url('Classes/search')}";
    $search_xu="{:url('Classes/searchxu')}";
})
</script>
</body>
</html>
